import axios from "axios";

export default {
  namespaced: true,
  state: {
    city: {}
  },
  mutations: {
    getCities(state, cities) {
      state.city = cities
    }
  },
  actions: {
    async getCities({commit}) {
      await axios({
        url: 'http://localhost:3000/city',
        method: 'GET'
      }).then(res => {
        commit('getCities', JSON.parse(res.data.data))
      })
    }
  }
}